
		//结构赋值
		const {createApp}=Vue
		const app=createApp({
			data(){
				return {
					goods,
					psf:5,
					begin:30,
					jumpIcon:{
						show:false,
						point:{
							x:0,y:0
						}
					}
				}
			},
			methods:{
				addNum(obj,el){
					obj.num++
					obj.all=obj.price*obj.num
					this.startJump(el)
				},
				startJump(el){
					const rect = el.target.getBoundingClientRect()
					this.JumpStyle.show=false
					setTimeout(()=>{
						this.jumpIcon.show=true
						this.jumpIcon.point.x=rect.left+rect.width/2
						this.jumpIcon.point.y=rect.top+rect.height/2
					},0)
					
					
					setTimeout(()=>{
						const rect = this.$refs.footIcon.getBoundingClientRect()
						this.jumpIcon.point.x=rect.left+rect.width/2
						this.jumpIcon.point.y=rect.top+rect.height/2
					},1)
				},
				loss(obj){
					if(obj.num<=0){
						return;
					}
					obj.num--
					obj.all=obj.price*obj.num
				},
				jumpEnd(){
					this.jumpIcon.show=false
					this.$refs.footIcon.classList.add('animate')
					
				},
				removeAnimate(){
					this.$refs.footIcon.classList.remove('animate')
				}
				
			},
			mounted(){
				this.goods=this.goods.map(val=>{
						return {
							...val,
							num:0,
							all:0
						}
					})
			},
			computed:{
				payPage(){
					let num=0,pay=0
					this.goods.forEach(obj=>{
						num+=obj.num
						pay+=obj.all
					})
					return{
						num,
						pay,
						psf:this.psf,
						begin:this.begin-pay
					}
				},
				JumpStyle(){
					return {
						divStyle:{
							transform:`translateX(${this.jumpIcon.point.x}px)`
						},
						iconStyle:{
							transform:`translateY(${this.jumpIcon.point.y}px)`
						}
					}
				}
			},
			watch:{
			},
		})
		//创建实例
		const vm=app.mount("body")